package anaglyph;
import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.media.opengl.awt.GLCanvas;
import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;

import com.jogamp.opengl.util.FPSAnimator;


public class AnaglyphApplet extends JApplet 
{
	   private static final int CANVAS_WIDTH = 640;  // width of the drawable
	   private static final int CANVAS_HEIGHT = 480; // height of the drawable
	   private static final int FPS = 60; // animator's target frames per second
	public void init() 
	{
		//Execute a job on the event-dispatching thread; creating this applet's GUI.
		try {
			SwingUtilities.invokeAndWait(new Runnable() {
				public void run() {
					GLCanvas canvas = new Test();
		            canvas.setPreferredSize(new Dimension(CANVAS_WIDTH, CANVAS_HEIGHT));
		            add(canvas);
		 
		            // Create a animator that drives canvas' display() at the specified FPS.
		            final FPSAnimator animator = new FPSAnimator(canvas, FPS, true);
		            animator.start(); // start the animation loop
		 
				}
			});
		} catch (Exception e) 
		{
			System.err.println("createGUI didn't complete successfully");
		}
	}
}
